home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1994-12-08 | 31.8 KB | 880 lines | [ TEXT/R*ch]
C.S.M.P. Digest Fri, 12 Jun 92 Volume 1 : Issue 112 Today's Topics: System 7.1a query... InsideMacDA Inside Mac...C and Pascal? System 7...on the bleeding edge of the finder (bugs?) A few questions . . . mac programming reference books - any recommendations? MPW Jump Table Size Limit HELP! Handle woes Totally moronic question concerning color Black windows? The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly. These digests are available (by using FTP, account anonymous, your email address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon. edu. This is also the home of the comp.sys.mac.programmer Frequently Asked Questions list. The last several issues of the digest are available from sumex-aim.stanford.edu as well. These digests are also available via email. Just send a note saying that you want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will automatically receive each new digest as it is created. The digest is a collection of articles from the internet newsgroup comp.sys. mac.programmer. It is designed for people who read c.s.m.p. semi-regularly and want an archive of the discussions. If you don't know what a newsgroup is, you probably don't have access to it. Ask your systems administrator(s) for details. (This means you can't post questions to the digest.) The articles in these digests are taken directly from comp.sys.mac.programmer. They are not edited; all articles included in this digest are in their original posted form. The only articles that are -not- included in these digests are those which didn't receive any replies (except those that give information rather than ask a question). All replies to each article are concatenated onto the original article in the order in which they were received. Article threads are not added to the digests until the last article added to the thread is at least one month old (this is to ensure that the thread is dead before adding it to the digests). Send administrative mail to mkelly@cs.uoregon.edu. ------------------------------------------------------- From: klingspo@netlab.cis.brown.edu (Steve Klingsporn) Subject: System 7.1a query... Date: 26 Apr 92 03:00:39 GMT Organization: Brown University Does anyone out there (registered developer) have the System 7.1 alpha seed that supposedly went out to developers? Would someone be so kind as to mail me a floppy (FDHD) copy? I will reimburse for mailing and disks. Thanks. Steve Klingsporn 1032 Ashland Avenue WIlmette, IL 60091 +++++++++++++++++++++++++++ From: cory@enigami.mv.com (Cory Kempf) Date: 30 Apr 92 04:50:21 GMT Organization: EnigamI, Inc., Nashua, NH In article <td6cnINNb90@stanley.cis.Brown.EDU> (comp.sys.mac.system,comp.sys.mac.programmer), klingspo@netlab.cis.brown.edu (Steve Klingsporn) writes: > >Does anyone out there (registered developer) have the System 7.1 alpha >seed that supposedly went out to developers? > >Would someone be so kind as to mail me a floppy (FDHD) copy? >I will reimburse for mailing and disks. Well, I am an Apple Partner, and the first I heard of 7.1 alpha was the MacLeak article. According to the article, I was supposed to have received it about two weeks ago. My mailbox has been strangly bare. Does anyone out there actually HAVE 7.1? If you can't comment on it publicly, I would still like to know about it. thanks, +C - ------------------------------------------------------------- Cory Kempf EnigamI, Inc. cory@enigami.mv.com ...!decvax!enigami!cory Microsoft Free and Proud Of It!... ...Microsoft Products: Just Say no. +++++++++++++++++++++++++++ From: amanda@visix.com (Amanda Walker) Date: 4 May 92 00:04:30 GMT Organization: Visix Software Inc., Reston, VA cory@enigami.mv.com (Cory Kempf) writes: > My mailbox has been strangly bare. Does anyone out there actually > HAVE 7.1? If you can't comment on it publicly, I would still like > to know about it. I have a feeling MacLeak whiffed on this one. If it went out at all, it was probably only to selected seed sites. The latest unofficial-rumor-from-what-is-usually-a-reliable-source I have heard is that it's going to be one of things given out on CD at the WWDC. That'll still be covered by NDA, though... Whatever the case, I can't imagine anyone being anxious to get an *early* copy of an alpha release of Mac System Software, unless they're a serious masochist :). I'll wait until at least beta before I'll trust my hard disk to it. I like my data... Amanda Walker amanda@visix.com Visix Software Inc. +1 800 832 8668 - -- "It's not that simple, no matter how you wish it so. You made public statements from a position of false authority; now you're having them shoved down your throat. Welcome to netnews." --Thomas Maddox +++++++++++++++++++++++++++ From: rhessjr@west.darkside.com (Robert Hess) Date: 7 May 92 22:03:45 GMT Organization: Independent Consultant In article <1992May4.000430.4703@visix.com>, amanda@visix.com (Amanda Walker) writes: > I have a feeling MacLeak whiffed on this one. If it went out at all, it was > probably only to selected seed sites. The latest > unofficial-rumor-from-what-is-usually-a-reliable-source I have heard is that > it's going to be one of things given out on CD at the WWDC. That'll still be > covered by NDA, though... I know of at least two people who (claim to have) received CD's this week. Robert +++++++++++++++++++++++++++ From: cory@enigami.mv.com (Cory Kempf) Date: Thu, 7 May 92 22:35:24 EST Organization: EnigamI, Inc., Nashua, NH In article <1992May4.000430.4703@visix.com> (comp.sys.mac.system,comp.sys.mac.programmer), amanda@visix.com (Amanda Walker) writes: >Whatever the case, I can't imagine anyone being anxious to get an *early* copy >of an alpha release of Mac System Software, unless they're a serious masochist >:). I'll wait until at least beta before I'll trust my hard disk to it. I >like my data... Urr. Unfortunately, I have had the task of developing a SCSI device driver thrust upon me (belive me, I kicked and screamed, but to no avail). At present, it is almost done, but I heard this rumor that Apple has *FINALLY* gotten around to a rewrite of the SCSI manager in 7.1... if this is indeed the case, and if that rewrite can give improved I/O performance on the Quadra, I probably need to do something to my driver. Considering the state of the current SCSI docs, I would be supprised if this turned out to be an easy task -- building it the first time wasn't. So I want as much time to accomplish this as I can get! +C - ------------------------------------------------------------- Cory Kempf EnigamI, Inc. cory@enigami.mv.com ...!decvax!enigami!cory Microsoft Free and Proud Of It!... ...Microsoft Products: Just Say no. --------------------------- From: mj@brando.uwasa.fi (Matti Jakobsson) Subject: InsideMacDA Organization: University of Vaasa, Finland Date: Tue, 5 May 1992 12:26:32 GMT Help. I have tried to order the full version of InsideMacDA 2.0 from Bernard Gallet but my letter was bounced back. If you know the right address please send it by email. - --------------------------------------------------------------------- Matti Jakobsson E-mail: mj@uwasa.fi University of Vaasa Fax: +358-61-3248467 Vaasa Finland +++++++++++++++++++++++++++ From: EL1@calvacom.fr (Eric_LAPUYADE) Date: 10 May 92 13:23:08 GMT Organization: R.C.I CalvaCom Dans <1992May5.122632.14524@uwasa.fi> mj@brando.uwasa.fi (Matti Jakobsson) ecrit: >Help. I have tried to order the full version of InsideMacDA 2.0 >from Bernard Gallet but my letter was bounced back. >If you know the right address please send it by email. >--------------------------------------------------------------------- >Matti Jakobsson E-mail: mj@uwasa.fi >University of Vaasa Fax: +358-61-3248467 >Vaasa Finland Bernard has now moved back to France (south). You can email him at BG75@calvacom.fr. - Eric - --------------------------- From: chrism@col.hp.com (Chris Magnuson) Subject: Inside Mac...C and Pascal? Date: Wed, 6 May 1992 22:34:46 GMT Organization: HP Colorado Springs Division I would like to find a Desk accesory or something that tells me the Inside Macintosh calls in BOTH C and Pascal (or either one a different times). Is there something that does this? Thanks, Chris Magnuson chrism@col.hp.com Hewlett-Packard Company +++++++++++++++++++++++++++ From: /home/imperial/mes (Mark Stockwell) Organization: Shell Development Co., Bellaire Research Center, Houston TX Date: Sun, 10 May 92 19:24:38 GMT I believe that Symantec sell something very like what you're looking for. If memory serves, they even call it "Inside Mac DA". --------------------------- From: alen@crash.cts.com (Alen Shapiro) Subject: System 7...on the bleeding edge of the finder (bugs?) Date: 7 May 92 00:49:11 GMT Organization: Crash TimeSharing, El Cajon, CA *** WARNING...2-groups posted, modify message header accordingly *** I'm really getting into this system 7 thang. Have made my code-generator drag-and-drop with great success (and a lot of guesswork). Made an alias of the app, placed it (the alias) on the desktop and noted that files dragged over the alias also activate the app (nice touch...not trivial for the MacOS to handle (pun intended). I wanted to change the app to be selective about which files would select it when dragged over. After examining other apps with this feature, changed the "****" in the bndl resource to "TEXT", rebuilt the desktop and NOTHING would make it blacken. Rebooted, same result. Next I restored the **** in the bndl and rebuilt/rebooted. Now the alias-PARENT would blacken but the alias would not, even though the alias pointed to the correct parent. I fixed this by throwing the alias away and making another, which the finder immediately recognized as "drag-over-able". Looks like I broke the clever OS association in the finder for drag-and-drop. Anyone know how? FOLLOW-ON-PROBLEM. As a result of rebuilding the desktop so many times, another application document lost its association with its creating application. It too was on the desktop, it was not an alias, and its application was on another volume. Although it kept its icon, 7.0.1 said it could not find the application to launch (microphoneII v3.0.1). Stomped on this one by opening the document from within microphone and resaving the document over the original. NOTE, restarting the application and quitting did not fix this info-loss. I presume both problems have something to do with desktop file rebuilding and some subsequent information loss. Ideas anyone. - --alen alen@crash.cts.com ps what is the official apple doc for programming drag-and-drop features? I've done this stuff by guesswork and resedit investigations, I have inside-mac 1->5, I'll go look at the bookstore to see if apple has produced any more. pps I'm on a mac SE/30, system 7.0.1, tuneup 1.1.1, no VM, many inits. +++++++++++++++++++++++++++ From: colin@Cayman.COM (Colin "Atilla" Steele) Date: 11 May 92 19:01:24 GMT Organization: Cayman Systems Inc., Cambridge, MA Please post a summary of responses to this question - I'd love to hear the answers. - -- - ------------------------------------------------------------------------------ Colin Steele | Cayman Systems, 26 Landsdowne St., Cambridge, MA 02139 colin@cayman.com | (617) 494-1916 x209 | applelink D0523 | Fax (617) 494-9270 --------------------------- From: shaner@excite.educ.sfu.ca (Shane Rosborough) Subject: A few questions . . . Organization: Simon Fraser University, Burnaby, B.C., Canada Date: Fri, 8 May 1992 18:55:28 GMT I have a few questions for all you Mac Pascal gurus out there.... [1] What is the "accepted" or "best" method for doing simple animations, ie. moving an object (pict, or is there a better object to use?) across the screen, and in a selected pattern? [2] What is the procedure for displaying a QUICKTIME movie in a window? [3] Is there a way to "lock the screen"? When making a window containing a pict, when the screen background is black, the window creates a white box before loading in the picture. Any help on those three questions would be appreciated... An email response would be valued as I often don't have time to read/scan thru all the new posts to this group. SR. - ------------------------------------------------------------------------------- Shane Rosborough shaner@excite.educ.sfu.ca Student/Employee Have a G'day eh?! TEx@mozart.educ.sfu.ca Simon Fraser Univ. rosborou@mailserver.sfu.ca +++++++++++++++++++++++++++ From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy) Organization: Kalamazoo College Date: Sun, 10 May 1992 05:59:51 GMT shaner@excite.educ.sfu.ca (Shane Rosborough) writes: > >[3] Is there a way to "lock the screen"? When making a window containing a >pict, when the screen background is black, the window creates a white box >before loading in the picture. I believe that, if you set up the 'wctb' correctly, the window's first drawing will come out correctly. Could someone confirm or deny this? >An email response would be valued as I often don't have time to read/scan >thru all the new posts to this group. I'm forwarding this to Shane, but wanted to give y'all a chance to prove me wrong in the meantime... :-) - -- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy "Also thanks to: Inside Macintosh (except vol. V, ch. 27)" - the Tesserae "About..." box +++++++++++++++++++++++++++ From: shaner@excite.educ.sfu.ca (Shane Rosborough) Date: 10 May 92 20:53:08 GMT Organization: Simon Fraser University, Burnaby, B.C., Canada In article <1992May10.055951.3617@hobbes.kzoo.edu> k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes: > I believe that, if you set up the 'wctb' correctly, the window's first > drawing will come out correctly. Could someone confirm or deny this? That brings up another question. the wctb, I know how to open a pict file, but I've haven't seen any information on using a wctb (by the way, I'm IM-less, I don't have any of the volumes, so that's probably a big problem.) Any info on how to encorporate a wctb into my pict loading would be a help... - ------------------------------------------------------------------------------- Shane Rosborough shaner@excite.educ.sfu.ca Student/Employee Have a G'day eh?! TEx@mozart.educ.sfu.ca Simon Fraser Univ. rosborou@mailserver.sfu.ca +++++++++++++++++++++++++++ From: mlanett@void.ncsa.uiuc.edu (Mark Lanett) Date: 11 May 92 00:39:44 GMT Organization: University of Illinois at Urbana shaner@excite.educ.sfu.ca (Shane Rosborough) writes: >That brings up another question. the wctb, I know how to open a pict file, but >I've haven't seen any information on using a wctb (by the way, I'm IM-less, I >don't have any of the volumes, so that's probably a big problem.) Any info on >how to encorporate a wctb into my pict loading would be a help... If you don't have IM, go fetch the HyperCard version from Apple's ftp server. You can't do any Toolbox stuff w/o it. It's in /dts/mac/docs/stacks/spinside (ftp.apple.com). In fact, if you have the disk space (and MPW), I'd fetch 411 also. - -- Mark Lanett, NCSA Software Development - mlanett@uiuc.edu --------------------------- From: brownc@p4.cs.man.ac.uk (S91) Subject: mac programming reference books - any recommendations? Date: 8 May 92 11:22:08 GMT Hi netters! I'm quite new to macintosh programming - i've done a bit of pascal on other platforms, but very little for a windowing system (SRGP in UNIX) I obviously need to buy some reference books which would give details of toolbox routines and techniques and hints for using them - sample code would be helpful. I am particularly interested in learning about appleevents and appletalk programming, but would need general reference material too. I'm working with a very limited budget (which is why i havn't gone out and bought the Inside Mac series) Books i've considered are: Inside Mac I-VI Macintosh Revealed (I have Vol 2) Which Inside Mac volumes are: 1) Essential 2) Useful 3) Redundant (programming for IIsi upwards, using Sys 7) Thanks in advance for your help Chris Brown +++++++++++++++++++++++++++ From: edw@caligula.cts.com (Ed Watkeys) Date: 9 May 92 13:14:50 GMT Organization: Distant Software In article <brownc.705324128@p4.cs.man.ac.uk> (comp.sys.mac.programmer), brownc@p4.cs.man.ac.uk (S91) writes: > Which Inside Mac volumes are: > > 1) Essential > 2) Useful > 3) Redundant > > (programming for IIsi upwards, using Sys 7) > > Thanks in advance for your help > > Chris Brown > I. Essential -- even though it's ancient, most of it still applies. II. Essential, but a bit less so... (the File Manager's here...) III. Don't bother. (I don't think I've ever even looked at it...) IV. Helpful. Talks about HFS and some other Mac Plus stuff. V. Essential/Helpful. Essential if you want to do color. Helpful otherwise. VI. Essential. This is my opinion. If you don't like Sys 7, don't get it... In addition to this I'd suggest you get THINK Reference. While it's currently only current with IM V, I talked to Symantec and they implied that it would be updated for System 7 eventually. It's really handy for programming (my knees have gotten all messed up from crossing my legs and putting IM VI and I on them... but no more!). Ed - -- Ed Watkeys (Drexel U. Comp Sci) "Moral judgement and condemnation is edw@caligula.cts.com the favorite form of revenge for the edw%caligula@phlpa.pha.pa.us spiritually limited on those who are ls.com!phlpa!caligula!edw less so...." -- Friedrich Nietzsche --------------------------- From: kad@rocky.den.mmc.com (Kurt DeShazer) Subject: MPW Jump Table Size Limit Organization: Martin Marietta Astronautics, Denver Date: Fri, 8 May 1992 22:19:21 GMT I am a new user of MPW C, and am finding linking to be a little tough. I have created a library with the LIB command. Then while I link my library into my main program, I am getting the following error: ### LINK: ERROR: Jump table offset into code segment is greater than 32K. (ERROR 50) <My_Routine>. Where <My_Routine> is the name of an external routine used either in my code, or in one of the comercial libraries that I am linking to. This error shows up for many bu not all external routines. The MPW manul suggest a -ss option that will allow segments that are greater than 32K, but when I use this option, I get the following message"-ss is obsolete. There are no segment size limitations", followed by a list of the same error messages shown above. Has anyone ever tried to reach APDA tech support. Apple gave me the biggest runaround that I have ever experienced! :-( Kurt DeShazer kad@omni.den.mmc.com +++++++++++++++++++++++++++ From: mlanett@void.ncsa.uiuc.edu (Mark Lanett) Organization: University of Illinois at Urbana Date: Sat, 9 May 1992 11:02:11 GMT kad@rocky.den.mmc.com (Kurt DeShazer) writes: > I am a new user of MPW C, and am finding linking to be a little tough. I >have created a library with the LIB command. Then while I link my library into >my main program, I am getting the following error: >### LINK: ERROR: Jump table offset into code segment is greater than 32K. > (ERROR 50) <My_Routine>. Try using (linker options) -l (or -la or -lf or -map) to figure out which segment is overflowing. Then segment your code again and move stuff out of there (scatter '#pragma segment <segment>' calls through the code). - -wrap is a potential solution; so is model far (compile and link with the model far options on). - -- Mark Lanett, NCSA Software Development - mlanett@uiuc.edu --------------------------- From: pittenger-laurence@CS.YALE.EDU (Laurence Arthur Pittenger) Subject: HELP! Handle woes Organization: Yale University Computer Science Dept., New Haven, CT 06520-2158 Date: Sat, 9 May 1992 05:37:55 GMT I have a utility routine to check if a handle is pointing to a certain structure. It does this by the straightforward call: Boolean okHandle = (GetHandleSize(h) == sizeof (myStructure)); But sometimes GetHandleSize(h) will give a bus error, for instance when it is garbage and doubly dereferencing it (**h) yields a bus error. [note: oddly, even though (*h) gives an acceptable, albeit garbage, value, GetPtrSize((Ptr)h) also gives a bus error. Why?] All the handle-related memory routines seem to have the same problem. How do I check the value of h to make sure that it is such that it won't crash my program if I call GetHandleSize? Surely there must be a way to do this -- it is very basic programming protocol to have a check function for one's structures, and even the Mac interface programmers couldn't have been so irresponsible so as to leave out such a check function for Handles, could they?... [don't flame me if this is somewhere in I.M. -- I don't have my manuals here. I did check the Hypercard version of I.M., but no luck there.] thanks in advance, LP - -- Laurence A. Pittenger CSNET : pittenger-laurence@cs.yale.edu BITNET : pitlaua@yalevm , pittenger-laurence@yalecs +++++++++++++++++++++++++++ From: mhall@occs.cs.oberlin.edu (Matthew Hall) Organization: Oberlin College Computer Science Date: Sat, 9 May 1992 20:05:50 GMT In article <1992May9.053755.22858@cs.yale.edu> pittenger-laurence@CS.YALE.EDU (Laurence Arthur Pittenger) writes: > I have a utility routine to check if a handle is pointing to a certain > structure. It does this by the straightforward call: > > Boolean okHandle = (GetHandleSize(h) == sizeof (myStructure)); > > But sometimes GetHandleSize(h) will give a bus error, for instance > when it is garbage and doubly dereferencing it (**h) yields a bus > error. > > [note: oddly, even though (*h) gives an acceptable, albeit garbage, > value, GetPtrSize((Ptr)h) also gives a bus error. Why?] > > All the handle-related memory routines seem to have the same problem. > How do I check the value of h to make sure that it is such that it > won't crash my program if I call GetHandleSize? The size of the handle is stored in a header block to the data. The handle itself contains the address of a pointer to the data. The header is something like the 12 bytes before tha data. There is also all sorts of other information there. When you GetHandleSize, the mac reads the block header. If your handle is garbage, likely it points to an address way out of range of your memory (unless you have 4 gig) and trying to read that creates a bus error. If you try to read a nil handle, this will usually happen as well, since most development environments or debuggers set the value at 0000000 to one that will assuredly cause a bus error, (TMON sets it to 'NIL!'). So, what to do? Make sure that if your handle is not valid, that it points to NIL - set them all at startup, and set each handle to nil after disposing them. then in your check function, first check to see if the handle points to nil. If it does, DON'T use gethandle size, but return false. Makes code a little messier, but also makes it work. hope this halps - -matt hall - -- - ------------------------------------------------------------------------------- Matt Hall. mhall@occs.cs.edu OR SMH9666@OBERLIN.BITNET (216)-775-5805 (That's a Cleveland Area code. Lucky Me) "If a man comes up to you and says: 'A dog just carried away your ear.' Do you run after the dog, or search first for your ear?" - Moon over Morocco +++++++++++++++++++++++++++ From: scott@mcl.mcl.ucsb.edu (Scott Bronson) Date: 10 May 92 02:09:17 GMT In <MHALL.92May9150550@occs.cs.oberlin.edu> mhall@occs.cs.oberlin.edu (Matthew Hall) writes: >So, what to do? Make sure that if your handle is not valid, that it >points to NIL - set them all at startup, and set each handle to nil >after disposing them. then in your check function, first check to see >if the handle points to nil. If it does, DON'T use gethandle size, >but return false. Makes code a little messier, but also makes it work. THINK has some utility routines in their class library to solve problems very much like these. I find them very handy and include my own equivalents in all of my projects. I'm at school now, so I can't verify these macros (they're just off the top of my head). It shouldn't be too hard to get the general idea, though. #include "StdSyntaxDisclaimer" #define ForgetHandle(h) DisposeHandle(h);h=0 #define ForgetFile(f) Close(f);f=0 ... So, you'll never accidentally get good data from a released handle or related memory problems (you'll always bus error if you're using Mr._Bus_Error or debugger that does the same thing). Note that if you try to close a file using an invalid nonzero file reference number, you could corrupt other files. These macros solve all that. - Scott +++++++++++++++++++++++++++ From: cstrockb@cs.sunysb.edu (Caleb Strockbine) Date: 11 May 92 03:17:57 GMT Organization: SUNY at Stony Brook Computer Science Dept. In article <scott.705463757@mcl> scott@mcl.mcl.ucsb.edu (Scott Bronson) writes: In <MHALL.92May9150550@occs.cs.oberlin.edu> mhall@occs.cs.oberlin.edu (Matthew Hall) writes: >So, what to do? Make sure that if your handle is not valid, that it >points to NIL - set them all at startup, and set each handle to nil >after disposing them. then in your check function, first check to see >if the handle points to nil. If it does, DON'T use gethandle size, >but return false. Makes code a little messier, but also makes it work. Tech Note #51 seems to address this problem too. It suggests a nifty way to find problems of this sort using calls to PurgeMem() and then CompactMem(). Basically, you do something like: long MaxSize = 0x800000; PurgeMem(MaxSize); size = CompactMem(MaxSize); As the note explains, including these lines in your event loop is sure to shake things up in memory so that you find errors like dereferencing unlocked handles or invalid pointers "very quickly." Also makes your app slow as molasses, but that's OK for debugging purposes. Check out the note. Caleb Strockbine cstrockb@ic.sunysb.edu Flames via e-mail, please. --------------------------- From: edw@caligula.cts.com (Ed Watkeys) Subject: Totally moronic question concerning color Date: Sat, 9 May 92 00:34:17 EDT Organization: Distant Software OK, I'd like to know how to do the following: I have two RGBColor variables, foreColor and backColor. I would like to set the content area of a window to backColor (or the closest match) and set the pen to foreColor (or the closest match). Currently, I am attempting to do this pretty much like this (in Pascal...) testWindow := GetNewCWindow(128, nil, WindowPtr(-1)); SetPort(testWindow); aColor.red := 70; aColor.green := 70; aColor.blue := 70; RGBBackColor(aColor); aColor.red := 200; aColor.green := 200; aColor.blue := 200; RGBForeColor(aColor); GetFNum('Monaco', fontNum); TextFont(fontNum); TextSize(9); ... SizeWindow(testWindow, pixelWidth, pixelHeight, false); ShowWindow(testWindow); MoveTo(5, fontHeight + 13); Line(pixelWidth - 10, 0); Can I use GetNewCWindow without a wctb? I'm very confused about this color stuff. Respond via email or news; I keep up to date... Ed - -- Ed Watkeys (Drexel U. Comp Sci) "Moral judgement and condemnation is edw@caligula.cts.com the favorite form of revenge for the edw%caligula@phlpa.pha.pa.us spiritually limited on those who are ls.com!phlpa!caligula!edw less so...." -- Friedrich Nietzsche +++++++++++++++++++++++++++ From: edw@caligula.cts.com (Ed Watkeys) Date: 9 May 92 13:28:07 GMT Organization: Distant Software In article <01050133.31jk85@caligula.cts.com> (comp.sys.mac.programmer), edw@caligula.cts.com (Ed Watkeys) writes: > > OK, I'd like to know how to do the following: > > I have two RGBColor variables, foreColor and backColor. I would like to set > the content area of a window to backColor (or the closest match) and set the > pen to foreColor (or the closest match). Currently, I am attempting to do > this pretty much like this (in Pascal...) > > testWindow := GetNewCWindow(128, nil, WindowPtr(-1)); > SetPort(testWindow); > aColor.red := 70; > aColor.green := 70; > aColor.blue := 70; > RGBBackColor(aColor); > aColor.red := 200; > aColor.green := 200; > aColor.blue := 200; > RGBForeColor(aColor); > GetFNum('Monaco', fontNum); > TextFont(fontNum); > TextSize(9); > ... > SizeWindow(testWindow, pixelWidth, pixelHeight, false); > ShowWindow(testWindow); > MoveTo(5, fontHeight + 13); > Line(pixelWidth - 10, 0); > > Can I use GetNewCWindow without a wctb? I'm very confused about this color > stuff. Respond via email or news; I keep up to date... > > Ed > And totally morinic I was... The color I specified for the foreground color was essentially black once it went throught the Palette Mgr -- I didn't know that the range for each color was 0-65535. Sorry for the bandwidth... Ed - -- Ed Watkeys (Drexel U. Comp Sci) "Moral judgement and condemnation is edw@caligula.cts.com the favorite form of revenge for the edw%caligula@phlpa.pha.pa.us spiritually limited on those who are ls.com!phlpa!caligula!edw less so...." -- Friedrich Nietzsche --------------------------- From: a-giles@uchicago.edu (Aaron Giles) Subject: Black windows? Organization: University of Chicago High Energy Physics Date: Mon, 11 May 1992 03:54:42 GMT Is there any simple way to make the default color for windows black? Right now, whenever a window has to be redrawn, the system makes it white, which I just then black out and proceed with my drawing. It works, but it's not exactly "elegant". The "flashing" effect I get is annoying, and I know there's got to be a way to just make it black all the time. It would make me really happy if I could do with without having to deal with a new WDEF. :-) Thanks in advance, Aaron - ----- Aaron Giles -- a-giles@uchicago.edu "You can't have everything ... where would you put it?" +++++++++++++++++++++++++++ From: oster@well.sf.ca.us (David Phillip Oster) Date: 11 May 92 05:14:09 GMT Organization: Whole Earth 'Lectronic Link There are a couple of things you can do to avoid the O.S. giving you an initial white window: If it is a color machine, give ti a wctb with black as the background color. a.) create it from a WIND resource, and give it a 'wctb' with the same number. b.) create it inivisible, and associate the 'wctb' before making it visible. Inside Mac Vol 1, Window Manager chapter documents a global variable you can set immediately before making the window viisible that causes the O.S. to omit clearing the contents area to white. (The desktop just shows through until you clear it at the beginning of your update routine.) Use a custom WDEF to make the whole window be "windowFame" then you can do what ever you want in yor wdef code. (Remember that the WDEF won't necessarily run with the same A5 as your application under Sys 7 or multifinder.) +++++++++++++++++++++++++++ From: news@massey.ac.nz (USENET News System) Date: Tue, 12 May 92 08:52:55 GMT Organization: School of Maths. and Info. Sci., Massey University, Palmerston North, NZ In article <1992May11.051409.17197@well.sf.ca.us> oster@well.sf.ca.us (David Phillip Oster) writes: >If it is a color machine, give ti a wctb with black as the background color. > a.) create it from a WIND resource, and give it a 'wctb' with the same > number. > b.) create it inivisible, and associate the 'wctb' before making it > visible. >Inside Mac Vol 1, Window Manager chapter documents a global variable you can >set immediately before making the window viisible that causes the O.S. to omit >clearing the contents area to white. (The desktop just shows through until you >clear it at the beginning of your update routine.) On a b&w or colour machine, create the window (preferably without showing it), then call BackColor(black) and show it. All erasing is then done in black instead of white, so the window goes black. Brent --------------------------- End of C.S.M.P. Digest **********************